package controller;

import java.io.File;

import javax.swing.JFileChooser;


import view.AppView;

public class LoadWordsListener extends AbstractActionListener {

	public LoadWordsListener(AppView view)
	{
		super(view);
	}

	@Override
	protected void myAction()
	{
		final JFileChooser fc = new JFileChooser(".");
		fc.setMultiSelectionEnabled(true);
		int returnVal = fc.showOpenDialog(view);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File[] files = fc.getSelectedFiles();
            model.setUpWords(files);
            refresh();
        }
	}
}